import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class HmacCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'hmac'
        command.component = 'AllowCopyCommandComponent'

        return new HmacCommand(command, false)
    }

    usage(): string {
        return 'hmac [-u] [-5] -k key 字符串'
    }

    description(): string {
        return `<div>HMAC算法实现，支持SHA256、SHA512两种模式，默认为SHA256</div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">-u --upper</span><span>将结果转为大写</span></div>
        <div class="option-row"><span class="option-option">-5 --512</span><span>指定SHA512模式</span></div>
        <div class="option-row"><span class="option-option">-k --key</span><span>加密KEY</span></div>`
    }
}
